//
//  SQLHelper.h
//  LoveHealth
//
//  Created by 陈永坤 on 14-9-25.
//  Copyright (c) 2014年 lanou. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDB.h"
#import "HealthFoodDetail.h"
#import "HealthKnowledgeDetail.h"
#import "HealthNewsDetail.h"


#define KnewsTableName @"news"
#define KfoodTableName @"food"
#define KknowledgeTableName @"knowledge"
#define KID @"id"
#define Ktitle @"title"
#define Kdata @"data"

#define KarchiverKey @"loveHealth"
@interface SQLHelper : NSObject


@property (nonatomic,retain)FMDatabase * db;

+ (SQLHelper *)shareInstance;

//- (void)openDB;
//- (void)createTable;

- (BOOL)insertWithValue:(id)value
           tableName:(NSString *)tableName;

-(BOOL)deleteWithID:(NSInteger)ID
          tableName:(NSString *)tableName;

- (NSArray *)selectAllWithTableName:(NSString *)tableName;

- (BOOL)existWithID:(NSInteger)ID
                tableName:(NSString *)tableName;
@end
